Production equipment and production methods have rapidly changed in industrial fields, particularly in production fields, independent of the scale of a field, and the range of electrical-system controllers for equipment and systems for production has been increasing year after year. Therefore, it is important in communicating with a mechanical system, rationally to improve the cost performance, and realize a high-speed easy-to-handle user interface in this environment.
Conventionally, programmable controllers (PC) and development environment for controlling the controllers have been developed that realize the above-mentioned conditions. A programmable controller is also referred to as a programmable logic controller (PLC) or sequencer. The programmable controller generally operates in accordance with the description of a special control program for sequential processing.
The sequential processing has a basic processing flow of receiving a signal from an input device such as a sensor or switch and transmitting a control signal to an output device such as an indicator or electromagnetic relay in accordance with a state of the received signal or a specific order. That is, a control program is a program in which the flow of the above sequential processing is described.
In general, the control program is developed by a universal computer such as a personal computer or program loader (hereafter referred to as control-program-development supporting apparatus) and transferred to a programmable controller through a communication interface.
The ladder diagram system, function-block diagram system, structured text system, and SFC (Sequential Function Chart) system are typically known among languages for describing a control program. Particularly, the ladder diagram system is a system in which a circuit diagram is drawn like a ladder, two vertical lines at the both ends of the ladder symbolically show motive power, and the flow of the motive power of a relay contact circuit is shown on a line horizontally connected between the two lines, which is a language most widely used.
The ladder diagram system first expresses the flow of sequential processing in accordance with the arrangement of graphic symbols which can be intuitively understood by a person as described above and then converts the arrangement of the graphic symbols into an instruction list shown by mnemonic codes which can be interpreted by a programmable controller by a converter such as a control-program-development supporting apparatus.
Therefore, the programmable controller may use a configuration for receiving the instruction list and executing sequential processing in accordance with instructions shown by the instruction list. In this case, the programmable controller sequentially executes a control program by interpreting the received instruction list line by line, that is, by converting the list into code directly executable by a microprocessor mounted on the programmable controller. The programmable controller is hereafter referred to as interpreter-type programmable controller.
Moreover, a compiling-type programmable controller is practically used as another type of programmable controller that receives directly-executable code from a control-program-development supporting apparatus through a microprocessor in the programmable controller and executes the codes. In the case of the configuration using the compiling-type programmable controller, a control-program-development supporting apparatus is provided with a compiler, which converts a ladder diagram directly or temporarily into an instruction list by the compiler and then compiles the list into code directly executable by the microprocessor and transfers the execution codes to the programmable controller.
However, because the above control program depends on the vendor or type of programmable controller, it is impossible to execute the same sequential processing between different types of programmable controllers by using control programs having the same source code. Therefore, it is necessary to develop a new control program or transplant a new model or different model to a programmable controller and thus, it is difficult to effectively use past properties of a control program.
Therefore, a method is proposed which obtains execution codes by describing a control program with not a conventional sequential-processing language such as a ladder diagram or instruction list but an advanced programming language used for a personal computer and compiling the advanced programming language with a compiler.
For example, according to the advanced-language sequence instruction program generator and universal sequencer disclosed in Japanese Patent Laid-Open No. HEI 7-295612, the advanced-language sequence instruction program generator translates a language sequence instruction program into an advanced-language sequence instruction program with a translation program and compiles the advanced-language sequence instruction program to generate an execution-type sequence instruction program. Or, the universal sequencer executes the advanced-language sequence instruction program while sequentially interpreting the program. Thereby, it is possible to execute sequential control with the same control program independently of the vendor or type of a sequencer.
Moreover, the following two methods are known in order to update the contents of a control program stored in a program controller. One of them is a method in which a control-program-development supporting apparatus transfers a control program to a programmable controller currently stopped and the programmable controller starts execution processing after reception of the control program is completed.
The other of them is a method (hereinafter, referred to as under-RUN writing method) in which a programmable controller rewrites the contents of a control program currently executed to contents of a new control program while continuing the execution state. A programmable controller normally operates by repeatedly interleaving and executing a loop of a binary-code string corresponding to each instruction to be executed one-to-one. This method is realized by first reading a new control program into an idle memory space and when reading of the program is completed, stopping the execution of an original control program and starting the execution of the new control program at the start or end timing of the loop.
Moreover, a so-called software programmable controller is practically used in which development and debugging of a control program realized by the above control-program-development supporting apparatus and sequential processing of a programmable controller are realized by one system. The configuration of the software programmable controller is the same as that of a universal computer, in which sequential processing to external input and output devices is realized by software.
However, the above-described programmable controller and control-program-development supporting apparatus have the following problems.
Firstly, there is a problem that, because a microprocessor in a universal computer (hereafter referred to as universal Microprocessor), such as a personal computer, operates with an advanced function at a high speed and has become inexpensively available in recent years, the advantage of developing a microprocessor in a conventional programmable controller with an ASIC (Application Specific IC) is slowly decreasing.
Particularly, a universal microprocessor is provided with primary and secondary caches and constructed in accordance with acceleration of processing techniques such as pipeline processing, super-scaler processing and out-of-order processing and moreover, execution codes directly executable by the universal microprocessor are also generated by a compiler for converting the execution codes into execution codes forming an optimum code system by fully using the acceleration techniques.
Because most compilers of the above universal computer compile a program described with an advanced programming language easily understandable by a user, it is very advantageous to mount a universal processor on a programmable control together with the above compilers and make the processor execute sequential processing. In the case of a universal computer, however, the start point of program development is set to description of an advanced programming language. Therefore, a problem occurs that it is impossible to make efficient use of a control program such as a ladder diagram or instruction list, that is, the past property of sequential processing.
Secondly, because a control program tends to be lengthened due to diversification of input and output devices and complication of sequential processing, there is a problem that a lot of time is necessary for development, compiling, interpreting, and debugging of the control program.
Thirdly, because a compiling-type programmable controller receives an execution code and directly starts sequential processing, there is a problem that it is difficult to estimate an actual processing time corresponding to each instruction unit or processing-block unit of an original control program.
Fourthly, though the “advanced-language sequence instruction program generator” disclosed in the above Japanese Patent Laid-Open No. HEI 7-295612 generates an object file by converting a source file described with the control program of an instruction list or the like into the source file of an advanced programming language such as C language, if only the source file of the advanced programming language is corrected. There is a problem that two source files showing the same sequential processing do not match each other because the source file of an original control program is not changed due to the above correction.
Particularly, in the case of a control-program-development supporting apparatus capable of developing a control program with an advanced programming language, to perform step execution by using a debugging tool, for example, step execution is possible for one line of the advanced programming language but it is impossible to perform step execution every line for a language configuration such as an instruction list before conversion into an advanced programming language.
Moreover, in general, at a job site where a programmable controller works, a control-program-development supporting apparatus capable of directly operating an advanced programming language is not set in many cases. Therefore, when a trouble occurs in sequential processing or a control program must be slightly corrected, debugging may be performed by using a simple control-program-development supporting apparatus capable of using only a sequential-processing language such as an instruction list. That is, in this case, the above problem becomes remarkable. To correspond to the above problem, it is necessary to prepare a control-program-development supporting apparatus capable of directly operating an advanced programming language in every job site but the cost for setting the system increases.
Fifthly, to realize the above-described under-RUN writing method, there is a problem that a memory having the same size as a memory in which a control program currently executed is read must be separately prepared. Because a memory is generally expensive among hardware parts, a maker or user must make a large investment in order to realize the under-RUN writing method.
Sixthly, the above-described compiling-type control-program-development supporting apparatus has a problem that it is generally impossible to restore a control program such as an original instruction list from finally generated execution codes. Therefore, when a programmable controller and a control-program-development supporting apparatus are set in housings separate from each other and they are separated from each other off-line, an original control program and an execution code actually executed are stored in places different from each other.
Particularly, in the case of a compiling-type control-program-development supporting apparatus, if the source file of a control program disappears at the control-program-development supporting apparatus side, it is impossible to restore the control program such as an instruction list and debugging becomes impossible. In this case, a control program must be rewritten from the beginning.
Moreover, even if the source file of a control program does not disappear, it is necessary to access a control-program-development supporting apparatus storing the source file of an original control program and fetch the file in order to change the processing contents of a programmable controller currently operated at a job site.
Seventhly, the above programmable controller or control-program-development supporting apparatus, independently of the interpreter type or compiling type, has a problem that the procedure for interpreting processing contents is not always efficient though a part for sequentially interpreting processing contents of a control program described by a user is present. The part for performing sequential interpretation (hereafter referred to as instruction interpreting unit) serves as a part for reading each data value constituting a control program when the program is executed and interpreting the execution of an instruction designated by the data value in the case of an interpreter-type programmable controller and serves as a part for sequentially reading and interpreting a control program and converting it into a proper output format in the case of a compiling-type control-program-development supporting apparatus.
An instruction interpreting unit is generally described with a structure of comparing input data with a pattern of the interpretation side and when the data and the pattern match each other, executing a previously-stored operation (action). Therefore, pattern matching of the instruction interpreting unit requires a lot of time when the operation is executed in the case of the interpreter type and when the operation is compiled in the case of the compiling type. Thus, both types have factors impeding productivity.